(function($, window) {
	var baseRequest = window.baseRequest;
	var appConfig = window.appConfig;
	//var commonTool = window.commonTool;
	var baseUrl = appConfig.v3ServiceUrl + '/sec_license';
	var v3License = window.v3License = {};
	
	var LicensedatabaseInfo = baseUrl + '?';
	v3License.getLicense = function(devSN, type, callback){
		baseRequest.commonGet( LicensedatabaseInfo + $.param({
			devSN:devSN,
			type:type
		}), 10000, function(code, data){
			if(code === 0){
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
		})
	}
	
//	devSN:210235A1FWH15A000047	 
//	type:GetLocalTime
	v3License.getLocalTime = function(devSN, type, callback){
		baseRequest.commonGet( LicensedatabaseInfo + $.param({
			devSN:devSN,
			type:type
		}), 10000, function(code, data){
			if(code === 0){
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
		})
	}
	
	
})(mui, window);